import Vue from 'vue'
// ② 导入vue-router
import VueRouter from 'vue-router'
// ③ 安装vue-router
Vue.use(VueRouter)

import Index from "../pages/Index.vue"
import Add from "../pages/Add.vue"
import List from "../pages/List.vue"
import Login from "../pages/Login.vue"
import Reg from "../pages/Reg.vue"
import Show from "../pages/Show.vue"
import User from "../pages/User.vue"
import Layout from "../pages/Layout.vue"
import Cate from "../pages/Cate.vue"
import Article from "../pages/User/Article.vue"
import Edit from "../pages/User/Edit.vue"
import Xiangq from "../pages/User/Xiangq.vue"
import Sc from "../pages/User/Sc.vue"
import Zan from "../pages/User/Zan.vue"

let router = new VueRouter({
    routes: [
        {
            path: '/',
            component: Layout,
            children: [
                {
                    path: '/',
                    component: Index
                }, {
                    path: '/add',
                    component: Add
                }, {
                    path: '/cate',
                    component: Cate
                }, {
                    path: '/user',
                    component: User,
                }
            ]
        }, {
            path: '/list/:cateid',
            component: List
        }, {
            path: '/login',
            component: Login
        }, {
            path: '/reg',
            component: Reg
        }, {
            path: '/show',
            component: Show
        }, {
            path: "/zan",
            component: Zan,
        },
        {
            path: "/article",
            component: Article,
        },
        {
            path: "/edit",
            component: Edit,
        },
        {
            path: "/xiangq",
            component: Xiangq,
        },
        {
            path: "/sc",
            component: Sc,
        },
    ]
})

export default router
